package com.yonyou.pmclouds.task.rmiitf;

import com.yonyou.pmclouds.basecom.entity.KeyCountVO;
import com.yonyou.pmclouds.basecom.entity.SuperVO;
import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.task.entity.TaskParamVO;
import com.yonyou.pmclouds.task.entity.TaskVO;
import com.yonyou.pmclouds.workflow.entity.ApproveInfoParam;
import com.yonyou.pmclouds.workflow.entity.ProcessTaskVO;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface TaskRemoteService {

    TaskVO insertTaskVO(TaskVO taskVO) throws BusinessException;

    TaskVO[] insertTaskVOs(TaskVO[] taskVOs) throws BusinessException;

    /**
     * 方法功能描述：待办任务完成接口。
     * <p>
     * <b>参数说明</b>
     *
     * @return
     * @throws BusinessException
     * @author zhangwce
     * @time 2017年11月24日 下午8:25:08
     */
    TaskVO[] finishTask(String pkBill, String pkReceiver, byte billstatus) throws BusinessException;

    /**
     * 方法功能描述：提供给业务单据自主批量生成代办或任务的接口。
     * <p>
     * TODO 由于目前批量生成代办和任务的接口的应用场景为检查记录推问题，因此并不需要考虑任务的前置任务问题，但以后需要补充
     * <p>
     * <p>
     * <b>参数说明</b>
     *
     * @param busiVOs
     * @param paramMap
     * @return
     * @author zhangwce
     * @time 2017年3月6日 下午18:54:41
     */
    TaskVO[] insertWithBuziVOs(SuperVO[] busiVOs, Map<String, TaskParamVO> paramMap) throws BusinessException;


    TaskVO[] insertTaskVOForWorkFlow(ApproveInfoParam approveInfoParam, byte billstatus, ProcessTaskVO[] processTaskVOS) throws BusinessException;

    /**
     * 保存待办的入口
     *
     * @param busiVO
     * @param paramVO
     * @return
     * @throws BusinessException
     */
    TaskVO[] insertWithBuziVO(SuperVO busiVO, TaskParamVO paramVO) throws BusinessException;

    /**
     * 更新单据状态（多个接收人全部接收后）
     *
     * @param pkBill
     * @param pkReceiver
     * @param billstatus
     * @return
     * @throws BusinessException
     */
    TaskVO[] updateBillStatus(String pkBill, String pkReceiver, byte billstatus) throws BusinessException;

    /**
     * 统计指定项目的单据数
     */
    @Deprecated
    int queryBillCountByProjects(String[] projects, String[] excludeBillType, Date timeStart, Date timeEnd);

    @Deprecated
    KeyCountVO[] queryProjectBillCount(String[] projects, String[] excludeBillType, Date timeStart, Date timeEnd, int start, int offset);

    TaskVO[] queryByPkBill(String pkBill, String pkReceiver);

    TaskVO[] updateTaskStatus(List<String> pkTasks) throws BusinessException;

}
